<?php
class WeiboOauth
{
	public function getRequestToken()
	{
		$saeOauth = new SaeTOAuth(Config::$WB_AKEY, Config::$WB_SKEY);
		$this->_requestToken = $saeOauth->getRequestToken();
		return $this->_requestToken;
	}
	
	public function getAuthorizeURL($key)
	{
		$saeOauth = new SaeTOAuth(Config::$WB_AKEY, Config::$WB_SKEY);
		$callBack = APP_HOST . Config::CALL_BACK;
		return $saeOauth->getAuthorizeURL($key['oauth_token'], 
				true, 
				$callBack);
	}
	
	public function getAccessToken($oauth_verifier)
	{
		$saeOauth = new SaeTOAuth( Config::$WB_AKEY , Config::$WB_SKEY , $_SESSION['key']['oauth_token'] , $_SESSION['key']['oauth_token_secret']  );
		return $saeOauth->getAccessToken($oauth_verifier);
	}
}